#include "render_globals.h"
#include "render_object.h"
#include "render.h"

void render_object::render(SDL_Event* e)
{


    mouse_over = false; // -- reset

    SDL_Rect p;
    p.x = box.x + re->view_x;
    p.y = box.y + re->view_y;
    p.w = p.x + box.w;
    p.h = p.y + box.h;

    if (e->motion.x > p.x && e->motion.x < p.w &&
        e->motion.y > p.y && e->motion.y < p.h)
            mouse_over = true;



    if (h == hash_body)
        re->render_body(this);

    if (h == hash_hr)
        re->render_hr(this);

    if (h == hash_img)
        re->render_image(this);

     if (h == hash__text)
        re->render_text(this);

};
